<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Linux操作 | lilei</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/images/icons/logo.png">
    <link rel="apple-touch-icon" href="/images/icons/logo.png">
    <link rel="manifest" href="/manifest.json">
    <script type="text/javascript" src="/assets/js/load.js"></script>
    <meta name="description" content="个人网站">
    <meta name="twitter:title" content="Linux操作">
    <meta name="twitter:description" content="">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:url" content="http://www.lileiblog.xyz/System/Linux%E6%93%8D%E4%BD%9C.html">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Linux操作">
    <meta property="og:description" content="">
    <meta property="og:url" content="http://www.lileiblog.xyz/System/Linux%E6%93%8D%E4%BD%9C.html">
    <meta property="og:site_name" content="lilei">
    <meta itemprop="name" content="Linux操作">
    <meta itemprop="description" content="">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/images/icons/logo.png">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="keywords" content="lilei,vue,vuepress,vuepress-theme,theme,主题,vuepress主题,blog
        ,vuepress-blog,java,python,shell,sql,golang,script,shell script,nginx,windows,去广告,androd,google drive
        ,one drive,idea,eclipse,git,小程序">
    <meta name="referrer" content="never">
    
    <link rel="preload" href="/assets/css/0.styles.8932179b.css" as="style"><link rel="preload" href="/assets/js/app.269009d6.js" as="script"><link rel="preload" href="/assets/js/3.974b9720.js" as="script"><link rel="preload" href="/assets/js/67.c18b00e4.js" as="script"><link rel="prefetch" href="/assets/js/10.5915e99b.js"><link rel="prefetch" href="/assets/js/11.ff732762.js"><link rel="prefetch" href="/assets/js/12.8bb86d91.js"><link rel="prefetch" href="/assets/js/13.18bde5b0.js"><link rel="prefetch" href="/assets/js/14.314fae34.js"><link rel="prefetch" href="/assets/js/15.0a4ff48f.js"><link rel="prefetch" href="/assets/js/16.ffaf1503.js"><link rel="prefetch" href="/assets/js/17.49a31a6e.js"><link rel="prefetch" href="/assets/js/18.7e6443bf.js"><link rel="prefetch" href="/assets/js/19.6880cc9a.js"><link rel="prefetch" href="/assets/js/20.1fb3f255.js"><link rel="prefetch" href="/assets/js/21.0cd39eea.js"><link rel="prefetch" href="/assets/js/22.392d85cb.js"><link rel="prefetch" href="/assets/js/23.f50adb15.js"><link rel="prefetch" href="/assets/js/24.43e324e1.js"><link rel="prefetch" href="/assets/js/25.e3663205.js"><link rel="prefetch" href="/assets/js/26.da141fb8.js"><link rel="prefetch" href="/assets/js/27.6c05235a.js"><link rel="prefetch" href="/assets/js/28.c124245a.js"><link rel="prefetch" href="/assets/js/29.d185870d.js"><link rel="prefetch" href="/assets/js/30.8587d422.js"><link rel="prefetch" href="/assets/js/31.dc382b56.js"><link rel="prefetch" href="/assets/js/32.20ba32e9.js"><link rel="prefetch" href="/assets/js/33.6ecd7de9.js"><link rel="prefetch" href="/assets/js/34.2b91c13a.js"><link rel="prefetch" href="/assets/js/35.66ed0733.js"><link rel="prefetch" href="/assets/js/36.ce7bca84.js"><link rel="prefetch" href="/assets/js/37.d00bb5ac.js"><link rel="prefetch" href="/assets/js/38.c3ecbb6f.js"><link rel="prefetch" href="/assets/js/39.308f4175.js"><link rel="prefetch" href="/assets/js/4.520f6ecc.js"><link rel="prefetch" href="/assets/js/40.f4b98bc2.js"><link rel="prefetch" href="/assets/js/41.95fae64f.js"><link rel="prefetch" href="/assets/js/42.fe4f877b.js"><link rel="prefetch" href="/assets/js/43.ca8f222e.js"><link rel="prefetch" href="/assets/js/44.4d4ee79e.js"><link rel="prefetch" href="/assets/js/45.79178b33.js"><link rel="prefetch" href="/assets/js/46.c3817d0b.js"><link rel="prefetch" href="/assets/js/47.b8252443.js"><link rel="prefetch" href="/assets/js/48.df9d5d3b.js"><link rel="prefetch" href="/assets/js/49.d812fdb2.js"><link rel="prefetch" href="/assets/js/5.f1a24a16.js"><link rel="prefetch" href="/assets/js/50.55cfcaa8.js"><link rel="prefetch" href="/assets/js/51.b8608b02.js"><link rel="prefetch" href="/assets/js/52.52c5e00d.js"><link rel="prefetch" href="/assets/js/53.3a9bd5fb.js"><link rel="prefetch" href="/assets/js/54.a4240c13.js"><link rel="prefetch" href="/assets/js/55.01c4b876.js"><link rel="prefetch" href="/assets/js/56.f29549a3.js"><link rel="prefetch" href="/assets/js/57.01438a04.js"><link rel="prefetch" href="/assets/js/58.29bb4626.js"><link rel="prefetch" href="/assets/js/59.e8b89408.js"><link rel="prefetch" href="/assets/js/6.8c478b39.js"><link rel="prefetch" href="/assets/js/60.bedb5381.js"><link rel="prefetch" href="/assets/js/61.bdfbe584.js"><link rel="prefetch" href="/assets/js/62.cb825d1a.js"><link rel="prefetch" href="/assets/js/63.a9516572.js"><link rel="prefetch" href="/assets/js/64.aa854ed7.js"><link rel="prefetch" href="/assets/js/65.285f883d.js"><link rel="prefetch" href="/assets/js/66.12849f37.js"><link rel="prefetch" href="/assets/js/68.fa59daa9.js"><link rel="prefetch" href="/assets/js/69.e9d5dda4.js"><link rel="prefetch" href="/assets/js/7.cfb0d0ea.js"><link rel="prefetch" href="/assets/js/70.db126cce.js"><link rel="prefetch" href="/assets/js/71.6acb04cd.js"><link rel="prefetch" href="/assets/js/72.7ff0ab11.js"><link rel="prefetch" href="/assets/js/73.9a66da79.js"><link rel="prefetch" href="/assets/js/74.0a38a030.js"><link rel="prefetch" href="/assets/js/75.7b32dbb3.js"><link rel="prefetch" href="/assets/js/8.cb9c08e5.js"><link rel="prefetch" href="/assets/js/9.ad652cfe.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.110a1065.js">
    <link rel="stylesheet" href="/assets/css/0.styles.8932179b.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/images/icons/logo.png" alt="lilei" class="logo"> <span class="site-name can-hide">lilei</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/Form/" class="nav-link">
  Form
</a></div><div class="nav-item"><a href="/IDE/" class="nav-link">
  IDE
</a></div><div class="nav-item"><a href="/Java/" class="nav-link">
  Java
</a></div><div class="nav-item"><a href="/Other/" class="nav-link">
  Other
</a></div><div class="nav-item"><a href="/Python/" class="nav-link">
  Python
</a></div><div class="nav-item"><a href="/SQL/" class="nav-link">
  SQL
</a></div><div class="nav-item"><a href="/Shell/" class="nav-link">
  Shell
</a></div><div class="nav-item"><a href="/System/" class="nav-link router-link-active">
  System
</a></div> <a href="https://github.com/woytu/notes-vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/Form/" class="nav-link">
  Form
</a></div><div class="nav-item"><a href="/IDE/" class="nav-link">
  IDE
</a></div><div class="nav-item"><a href="/Java/" class="nav-link">
  Java
</a></div><div class="nav-item"><a href="/Other/" class="nav-link">
  Other
</a></div><div class="nav-item"><a href="/Python/" class="nav-link">
  Python
</a></div><div class="nav-item"><a href="/SQL/" class="nav-link">
  SQL
</a></div><div class="nav-item"><a href="/Shell/" class="nav-link">
  Shell
</a></div><div class="nav-item"><a href="/System/" class="nav-link router-link-active">
  System
</a></div> <a href="https://github.com/woytu/notes-vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>System</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/System/" aria-current="page" class="sidebar-link">System</a></li><li><a href="/System/CentOS.html" class="sidebar-link">CentOS</a></li><li><a href="/System/Docker.html" class="sidebar-link">Docker</a></li><li><a href="/System/Linux操作.html" class="active sidebar-link">Linux操作</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/System/Linux操作.html#flag" class="sidebar-link">Flag</a></li><li class="sidebar-sub-header"><a href="/System/Linux操作.html#重装系统" class="sidebar-link">重装系统</a></li><li class="sidebar-sub-header"><a href="/System/Linux操作.html#后台运行daemon" class="sidebar-link">后台运行Daemon</a></li><li class="sidebar-sub-header"><a href="/System/Linux操作.html#传输文件" class="sidebar-link">传输文件</a></li><li class="sidebar-sub-header"><a href="/System/Linux操作.html#性能测试" class="sidebar-link">性能测试</a></li><li class="sidebar-sub-header"><a href="/System/Linux操作.html#网卡" class="sidebar-link">网卡</a></li></ul></li><li><a href="/System/Linux配置.html" class="sidebar-link">Linux配置</a></li><li><a href="/System/内网穿透.html" class="sidebar-link">内网穿透</a></li><li><a href="/System/挂载网盘.html" class="sidebar-link">挂载网盘</a></li><li><a href="/System/文件压缩解压.html" class="sidebar-link">文件压缩解压</a></li><li><a href="/System/邮箱.html" class="sidebar-link">邮箱</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="linux操作"><a href="#linux操作" class="header-anchor">#</a> Linux操作</h1> <p></p><div class="table-of-contents"><ul><li><a href="#flag">Flag</a></li><li><a href="#重装系统">重装系统</a><ul><li><a href="#meowlove">MeowLove</a></li><li><a href="#moeclub">moeclub</a></li></ul></li><li><a href="#后台运行daemon">后台运行Daemon</a><ul><li><a href="#tmux">Tmux</a></li><li><a href="#screen">Screen</a></li><li><a href="#nohup">nohup</a></li><li><a href="#setsid">setsid</a></li></ul></li><li><a href="#传输文件">传输文件</a><ul><li><a href="#scp">scp</a></li><li><a href="#sftp">sftp</a></li><li><a href="#rsync">rsync</a></li></ul></li><li><a href="#性能测试">性能测试</a></li><li><a href="#网卡">网卡</a><ul><li><a href="#mtu">MTU</a></li></ul></li></ul></div><p></p> <h2 id="flag"><a href="#flag" class="header-anchor">#</a> Flag</h2> <ul><li>Linux手册 <a href="https://learn-linux.readthedocs.io/zh_CN/latest" target="_blank" rel="noopener noreferrer">https://learn-linux.readthedocs.io/zh_CN/latest<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/tldr-pages/tldr" target="_blank" rel="noopener noreferrer">https://github.com/tldr-pages/tldr<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="http://www.linuxbaike.com" target="_blank" rel="noopener noreferrer">http://www.linuxbaike.com<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://network.fasionchan.com/zh_CN/latest/index.html" target="_blank" rel="noopener noreferrer">Linux网络编程<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://osx-guide.readthedocs.io/zh_CN/latest" target="_blank" rel="noopener noreferrer">OSX操作指南<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/guodongxiaren/LinuxTool" target="_blank" rel="noopener noreferrer">https://github.com/guodongxiaren/LinuxTool<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>Linux工具的最常用用法 <a href="https://github.com/me115/linuxtools_rst" target="_blank" rel="noopener noreferrer">https://github.com/me115/linuxtools_rst<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/GTFOBins" target="_blank" rel="noopener noreferrer">https://github.com/GTFOBins<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/dunwu/linux-tutorial" target="_blank" rel="noopener noreferrer">https://github.com/dunwu/linux-tutorial<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/jaywcjlove/linux-command" target="_blank" rel="noopener noreferrer">https://github.com/jaywcjlove/linux-command<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/jlevy/the-art-of-command-line" target="_blank" rel="noopener noreferrer">https://github.com/jlevy/the-art-of-command-line<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/idank/explainshell" target="_blank" rel="noopener noreferrer">https://github.com/idank/explainshell<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://www.linuxcool.com" target="_blank" rel="noopener noreferrer">https://www.linuxcool.com<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://man.linuxde.net" target="_blank" rel="noopener noreferrer">https://man.linuxde.net<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://www.gairuo.com/p/cron-expression-sheet" target="_blank" rel="noopener noreferrer">Cron 定时任务表达式手册<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><a href="http://c.biancheng.net/vi" target="_blank" rel="noopener noreferrer">vi命令（vi编辑器）<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://wiki.jikexueyuan.com/project/unix/the-vi-editor.html" target="_blank" rel="noopener noreferrer">vi 编辑器使用向导<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://wsgzao.github.io/post/vim" target="_blank" rel="noopener noreferrer">Vim 从小白到入门<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://vimjc.com/archives" target="_blank" rel="noopener noreferrer">https://vimjc.com/archives<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>软件套件</strong></p> <ul><li><a href="https://github.com/topics/lamp" target="_blank" rel="noopener noreferrer">https://github.com/topics/lamp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/topics/lnmp" target="_blank" rel="noopener noreferrer">https://github.com/topics/lnmp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/topics/lemp" target="_blank" rel="noopener noreferrer">https://github.com/topics/lemp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><a href="https://github.com/teddysun/lamp" target="_blank" rel="noopener noreferrer">https://github.com/teddysun/lamp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://lamp.sh" target="_blank" rel="noopener noreferrer">https://lamp.sh<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li><a href="https://github.com/oneinstack/oneinstack" target="_blank" rel="noopener noreferrer">https://github.com/oneinstack/oneinstack<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://oneinstack.com" target="_blank" rel="noopener noreferrer">https://oneinstack.com<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li><a href="https://github.com/licess/lnmp" target="_blank" rel="noopener noreferrer">https://github.com/licess/lnmp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://lnmp.org" target="_blank" rel="noopener noreferrer">https://lnmp.org<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li><a href="https://sourceforge.net/projects/xampp" target="_blank" rel="noopener noreferrer">https://sourceforge.net/projects/xampp<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://www.apachefriends.org" target="_blank" rel="noopener noreferrer">https://www.apachefriends.org<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li><a href="https://sourceforge.net/projects/wampserver" target="_blank" rel="noopener noreferrer">https://sourceforge.net/projects/wampserver<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><a href="https://www.moerats.com/archives/625" target="_blank" rel="noopener noreferrer">阿里云CentOS 7系统一键净化脚本<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/snapcore/snapd" target="_blank" rel="noopener noreferrer">https://github.com/snapcore/snapd<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>提供状态线和提示 <a href="https://github.com/powerline/powerline" target="_blank" rel="noopener noreferrer">https://github.com/powerline/powerline<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>替换服务器的固件 <a href="https://github.com/linuxboot/linuxboot" target="_blank" rel="noopener noreferrer">https://github.com/linuxboot/linuxboot<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <h2 id="重装系统"><a href="#重装系统" class="header-anchor">#</a> 重装系统</h2> <h3 id="meowlove"><a href="#meowlove" class="header-anchor">#</a> MeowLove</h3> <ul><li><a href="https://github.com/MeowLove/Network-Reinstall-System-Modify" target="_blank" rel="noopener noreferrer">https://github.com/MeowLove/Network-Reinstall-System-Modify<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code>yum update
yum <span class="token function">install</span> -y xz openssl <span class="token function">gawk</span> <span class="token function">file</span>
<span class="token comment"># 下载脚本</span>
<span class="token function">wget</span> --no-check-certificate <span class="token string">'https://raw.githubusercontent.com/MeowLove/Network-Reinstall-System-Modify/master/Network-Reinstall-System-Modify.sh'</span>
<span class="token comment"># 给脚本授权</span>
<span class="token function">chmod</span> a+x Network-Reinstall-System-Modify.sh
<span class="token comment"># 一键网络重装纯净CentOS 7</span>
<span class="token function">bash</span> Network-Reinstall-System-Modify.sh -CentOS_7
<span class="token comment"># 一键网络重装纯净Windows Server 2019</span>
<span class="token function">bash</span> Network-Reinstall-System-Modify.sh -Windows_Server_2019
</code></pre></div><ul><li>下载SHELL脚本（通过root用户运行）</li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">wget</span> --no-check-certificate -qO ~/Network-Reinstall-System-Modify.sh <span class="token string">'https://www.cxthhhhh.com/tech-tools/Network-Reinstall-System-Modify/Network-Reinstall-System-Modify.sh'</span> 

<span class="token function">chmod</span> a+x ~/Network-Reinstall-System-Modify.sh
</code></pre></div><ul><li>安装Linux系统</li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># ①. 一键网络重装纯净CentOS 7（推荐）</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -CentOS_7
<span class="token comment"># ②. 一键网络重装纯净CentOS 6</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -CentOS_6
<span class="token comment"># ③. 一键网络重装纯净Debian 10（推荐）</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Debian_10
<span class="token comment"># ④. 一键网络重装纯净Debian 9</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Debian_9
<span class="token comment"># ⑤. 一键网络重装纯净Debian 8</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Debian_8
<span class="token comment"># ⑥. 一键网络重装纯净Ubuntu 18.04（推荐）</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Ubuntu_18.04
<span class="token comment"># ⑦. 一键网络重装纯净Ubuntu 16.04</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Ubuntu_16.04
<span class="token comment"># ⑧. 一键网络重装纯净Ubuntu 14.04</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Ubuntu_14.04
</code></pre></div><ul><li>安装Windows系统</li></ul> <blockquote><p>警告：你需要购买来自Microsoft或其合作伙伴正版系统授权并激活系统使用。继续安装即代表您知悉并已经购买正版授权。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># ①. 一键网络重装纯净Windows Server 2019（推荐）</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_Server_2019
<span class="token comment"># ②. 一键网络重装纯净Windows Server 2016</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_Server_2016
<span class="token comment"># ③. 一键网络重装纯净Windows Server 2012 R2</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_Server_2012R2
<span class="token comment"># ④. 一键网络重装纯净Windows Server 2008 R2</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_Server_2008R2
<span class="token comment"># ⑤. 一键网络重装纯净Windows 7 Vienna</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_7_Vienna
<span class="token comment"># ⑥. 一键网络重装纯净Windows Server 2003</span>
<span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -Windows_Server_2003
</code></pre></div><ul><li>安装裸机系统部署平台</li></ul> <blockquote><p>仅适用于高端用户，手动安装任意系统。可通过网络ISO或iPXE安装任意系统。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -CXT_Bare-metal_System_Deployment_Platform
</code></pre></div><ul><li>安装DD系统</li></ul> <blockquote><p>如果您不了解这意味着什么，请不要进行操作。%ULR%应该替换为您自己的映像地址。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">bash</span> ~/Network-Reinstall-System-Modify.sh -DD <span class="token string">&quot;%URL%&quot;</span>
</code></pre></div><div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">bash</span> <span class="token operator">&lt;</span><span class="token punctuation">(</span><span class="token function">wget</span> --no-check-certificate -qO- <span class="token string">'https://zhujiwiki.com/wp-content/uploads/2018/04/InstallNET.sh'</span><span class="token punctuation">)</span> -dd <span class="token string">'https://hao.zhujiwiki.com/dd/CentOS_7.X_NetInstallation.vhd.gz'</span>
</code></pre></div><h3 id="moeclub"><a href="#moeclub" class="header-anchor">#</a> moeclub</h3> <ul><li><a href="https://moeclub.org/2018/04/03/603" target="_blank" rel="noopener noreferrer">https://moeclub.org/2018/04/03/603/<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <blockquote><p>适用于由GRUB引导的CentOS,Ubuntu,Debian系统</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code>yum update
yum <span class="token function">install</span> -y xz openssl <span class="token function">gawk</span> <span class="token function">file</span>
<span class="token comment"># 下载脚本</span>
<span class="token function">wget</span> --no-check-certificate <span class="token string">'https://moeclub.org/attachment/LinuxShell/InstallNET.sh'</span>
<span class="token comment"># 给脚本授权</span>
<span class="token function">chmod</span> a+x InstallNET.sh
<span class="token comment"># 一键网络重装纯净CentOS 7</span>
<span class="token function">bash</span> InstallNET.sh -c <span class="token number">7.6</span>.1810 -v <span class="token number">64</span> -a --mirror <span class="token string">'http://mirror.centos.org/centos'</span>
</code></pre></div><h2 id="后台运行daemon"><a href="#后台运行daemon" class="header-anchor">#</a> 后台运行Daemon</h2> <ul><li><a href="/Shell/Python笔记.html#daemon">Python版Daemon</a></li> <li><a href="/Go/Go笔记.html#daemon">Golang版Daemon更加简易可用</a></li> <li><a href="https://github.com/canonical/pebble" target="_blank" rel="noopener noreferrer">https://github.com/canonical/pebble<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/kovidgoyal/kitty" target="_blank" rel="noopener noreferrer">https://github.com/kovidgoyal/kitty<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <h3 id="tmux"><a href="#tmux" class="header-anchor">#</a> Tmux</h3> <blockquote><p><code>tmux</code>是一款<code>Linux</code>下的终端复用工具，可以开启不同的终端窗口来将应用程序作为后台守护进程执行，即使远程连接的SSH断开也不会影响程序的执行。</p></blockquote> <ul><li><a href="https://github.com/search?q=tmux" target="_blank" rel="noopener noreferrer">https://github.com/search?q=tmux<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/tmux/tmux" target="_blank" rel="noopener noreferrer">https://github.com/tmux/tmux<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/gpakosz/.tmux" target="_blank" rel="noopener noreferrer">https://github.com/gpakosz/.tmux<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/tmux-plugins" target="_blank" rel="noopener noreferrer">https://github.com/tmux-plugins<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="http://www.ruanyifeng.com/blog/2019/10/tmux.html" target="_blank" rel="noopener noreferrer">http://www.ruanyifeng.com/blog/2019/10/tmux.html<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://louiszhai.github.io/2017/09/30/tmux" target="_blank" rel="noopener noreferrer">https://louiszhai.github.io/2017/09/30/tmux<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://gist.github.com/MohamedAlaa/2961058" target="_blank" rel="noopener noreferrer">https://gist.github.com/MohamedAlaa/2961058<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://gist.github.com/ryerh/14b7c24dfd623ef8edc7" target="_blank" rel="noopener noreferrer">https://gist.github.com/ryerh/14b7c24dfd623ef8edc7<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <blockquote><p><code>tmux</code>分为<code>3</code>层，<code>Session</code>包含<code>Window</code>包含<code>Panes</code></p></blockquote> <p><strong>命令</strong></p> <blockquote><p>可在命令后加<code>--h</code>查看命令帮助，如：<code>tmux new --h</code></p></blockquote> <ul><li><code>yum install -y tmux</code> 安装</li> <li><code>tmux new -s 会话名称</code> 新建会话</li> <li><code>tmux attach -t 会话名称</code> 可进入到已经创建的会话
<ul><li>可使用<code>attach</code>前一部分字母，如<code>tmux a -t 会话名称</code></li></ul></li> <li><code>tmux ls</code> 列出所有会话</li> <li><code>tmux switch -t 会话名或会话编号</code> 切换会话</li> <li><code>tmux rename-session -t 会话名或会话编号 新会话名</code> 重命名会话</li> <li><code>tmux kill-session -t 会话名称</code> 关闭会话</li> <li><code>tmux kill-server</code> 关闭所有会话</li> <li><code>tmux split-pane -h</code> 左右分屏</li> <li><code>tmux spilt-pane -v</code> 上下分屏</li> <li><code>swap-window -s 3 -t 1</code>  交换 3 号和 1 号窗口</li> <li><code>swap-window -t 1</code> 交换当前和 1 号窗口</li> <li><code>move-window -t 1</code> 移动当前窗口到 1 号</li> <li><code>tmux new -s 会话名 -d &quot;命令&quot;</code> 创建新会话并在后台执行命令</li> <li><code>tmux neww -n 窗口名 -d &quot;命令&quot;</code> 新建窗口名并在后台执行命令</li></ul> <p><strong>快捷键</strong></p> <blockquote><p>所有的快捷键都是先按一下<kbd>Ctrl</kbd> + <kbd>B</kbd>松开，这时快捷键生效再按其他按键</p></blockquote> <ul><li><kbd>D</kbd> 快捷键可以退出当前终端窗口</li> <li><kbd>S</kbd> 列出所有会话，此时可通过方向键和回车键切换</li> <li><kbd>$</kbd> 重命名当前会话</li> <li><kbd>%</kbd> 左右分屏</li> <li><kbd>&quot;</kbd> 上下分屏</li> <li><kbd>:</kbd> 进入<code>tmux</code>命令行</li> <li><kbd>:new -s 会话名称</kbd> 创建并进入新的会话（不存在父子级关系）</li> <li><kbd>:kill-session</kbd> 删除当前会话</li> <li><kbd>:kill-server</kbd> 删除所有会话</li> <li><kbd>[</kbd>或<kbd>PgUp</kbd> 进入<code>copy mode</code>，查看<code>tmux</code>中的终端输出记录</li></ul> <blockquote><p>用<kbd>PgUp</kbd>、<kbd>PgDn</kbd>、<code>光标</code> 浏览历史输出了，按<kbd>q</kbd>退出</p></blockquote> <blockquote><p><code>copy mode</code>其实比较类似于<code>vi</code>/<code>emacs</code>里面一个只读<code>buffer</code>，可以移动光标，可以搜索，用C-SPC开始选择，选择完后用
<kbd>M</kbd> + <kbd>w</kbd>拷贝(会自动退出<code>copy mode</code>)，<kbd>]</kbd>可以粘贴, <kbd>=</kbd>从剪贴板历史中选择。</p></blockquote> <p><strong>开机运行</strong></p> <blockquote><p>在<code>vi /etc/rc.local</code>文件中按<kbd>Shift</kbd> + <kbd>g</kbd>（就是大写的G）跳转到末尾添加命令</p></blockquote> <blockquote><p>如果进入<code>tmux</code>时进行和<code>home</code>相关的操作时提示<code>$HOME</code>未设定，加入设置<code>home</code>目录命令：<code>export HOME=/home</code></p></blockquote> <blockquote><p>为防止启动执行失败，最好执行一次<code>chmod +x /etc/rc.d/rc.local</code>进行授权</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 创建新会话并在后台执行命令</span>
tmux new -s 会话名 -d <span class="token string">&quot;命令&quot;</span>

tmux new -s 会话名 -d <span class="token string">&quot;命令&quot;</span>
</code></pre></div><h3 id="screen"><a href="#screen" class="header-anchor">#</a> Screen</h3> <blockquote><p><code>Screen</code>是一款由<code>GNU</code>计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地或远程的命令行会话，并在其间自由切换。
<code>GNU Screen</code>可以看作是窗口管理器的命令行界面版本。它提供了统一的管理多个会话的界面和相应的功能。</p></blockquote> <ul><li><a href="http://www.gnu.org/software/screen" target="_blank" rel="noopener noreferrer">http://www.gnu.org/software/screen<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>命令</strong></p> <ul><li><code>yum install -y screen</code> 安装</li> <li><code>screen -S 会话名称</code> 创建一个会话</li> <li><code>screen -ls</code> 列出所有的会话列表</li> <li><code>screen -r 会话名称</code> 恢复会话窗口</li> <li><code>exit</code> 关闭会话窗口</li></ul> <p><strong>选项</strong></p> <ul><li><code>-A</code> 将所有的视窗都调整为目前终端机的大小。</li> <li><code>-d</code> &lt;作业名称&gt; 将指定的screen作业离线。</li> <li><code>-h</code> &lt;行数&gt; 指定视窗的缓冲区行数。</li> <li><code>-m</code> 即使目前已在作业中的screen作业，仍强制建立新的screen作业。</li> <li><code>-r</code> &lt;作业名称&gt; 恢复离线的screen作业。</li> <li><code>-R</code> 先试图恢复离线的作业。若找不到离线的作业，即建立新的screen作业。</li> <li><code>-s</code> 指定建立新视窗时，所要执行的shell。</li> <li><code>-S</code> &lt;作业名称&gt; 指定screen作业的名称。</li> <li><code>-v</code> 显示版本信息。</li> <li><code>-x</code> 恢复之前离线的screen作业。</li> <li><code>-ls</code>或<code>--list</code> 显示目前所有的screen作业。</li> <li><code>-wipe</code> 检查目前所有的screen作业，并删除已经无法使用的screen作业。</li></ul> <p><strong>快捷键</strong></p> <blockquote><p>所有的快捷键都是先按一下<kbd>Ctrl</kbd> + <kbd>A</kbd>松开，这时快捷键生效再按其他按键</p></blockquote> <ul><li><kbd>D</kbd> 隐藏并保留当前会话</li> <li><kbd>[</kbd>或<kbd>PgUp</kbd> 进入<code>copy mode</code>，查看<code>Screen</code>中的终端输出记录</li></ul> <blockquote><p>进入后它是<code>vi style keybindings</code>。对于拷贝文字，第一次空格设置开始标记，然后用<kbd>h</kbd>、<kbd>j</kbd>、<kbd>k</kbd>、
<kbd>l</kbd>、<kbd>w</kbd>移动光标，第二次空格完成拷贝。粘贴用<kbd>]</kbd></p></blockquote> <p><strong>开机启动screen并执行指定shell</strong></p> <ul><li>新建一个<code>start.sh</code>文件，示例路径：<code>/home/start.sh</code></li> <li>文件中输入如下代码<div class="language-sh extra-class"><pre class="language-sh"><code><span class="token assign-left variable">screen_name</span><span class="token operator">=</span><span class="token string">&quot;当前会话名称&quot;</span>
<span class="token function">screen</span> -dmS <span class="token variable">$screen_name</span>
<span class="token assign-left variable">cmd</span><span class="token operator">=</span><span class="token string">&quot;要执行的命令&quot;</span>
<span class="token function">screen</span> -x -S <span class="token variable">$screen_name</span> -p <span class="token number">0</span> -X stuff <span class="token string">&quot;<span class="token variable">$cmd</span>&quot;</span>
<span class="token function">screen</span> -x -S <span class="token variable">$screen_name</span> -p <span class="token number">0</span> -X stuff <span class="token string">$'<span class="token entity" title="\n">\n</span>'</span>
<span class="token function">screen</span> -x -S <span class="token variable">$screen_name</span> -p <span class="token number">0</span> -X stuff <span class="token string">&quot;exit&quot;</span>
</code></pre></div></li> <li>按<kbd>esc</kbd>然后再按<kbd>:</kbd>输入<code>wq</code>保存</li> <li>输入<code>vi /etc/rc.d/rc.local</code>按<kbd>i</kbd>或<kbd>Insert</kbd>再按<kbd>Shift</kbd> + <kbd>g</kbd>
（就是大写的G）跳转到末尾添加命令输入<code>/home/start.sh</code></li></ul> <h3 id="nohup"><a href="#nohup" class="header-anchor">#</a> nohup</h3> <blockquote><p>如果程序在其他目录下则在命令前加入<code>cd 目录路径 &amp;&amp;</code></p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 只输出错误日志</span>
<span class="token function">nohup</span> python3 ./index.py <span class="token operator">&gt;</span>/dev/null <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span>index.log <span class="token operator">&amp;</span>
<span class="token comment"># 不输出日志</span>
<span class="token function">nohup</span> python3 ./index.py <span class="token operator">&gt;</span>/dev/null <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">&amp;</span>
</code></pre></div><p><strong>Linux的3种重定向</strong></p> <ol><li><code>0</code>表示标准输入</li> <li><code>1</code>标准输出,在一般使用时，默认的是标准输出</li> <li><code>2</code>标准错误信息输出</li></ol> <ul><li>可以用来指定需要重定向的标准输入或输出。</li> <li>将某个程序的错误信息输出到log文件中：<code>./index 2&gt;index.log</code>。</li> <li>这样标准输出还是在屏幕上，但是错误信息会输出到log文件中。</li> <li>也可以实现0，1，2之间的重定向。<code>2&gt;&amp;1</code>：将错误信息重定向到标准输出。</li></ul> <p><strong>关于<code>/dev/null</code>文件</strong></p> <blockquote><p>Linux下还有一个特殊的文件<code>/dev/null</code>，它就像一个无底洞，所有重定向到它的信息都会消失得无影无踪。
这一点非常有用，当我们不需要回显程序的所有信息时，就可以将输出重定向到<code>/dev/null</code>。</p></blockquote> <h3 id="setsid"><a href="#setsid" class="header-anchor">#</a> setsid</h3> <blockquote><p><code>setsid</code>就是<code>set session id</code>的意思。表示该命令运行的进程是一个新的<code>session</code>。因此其父进程不属于当前终端。
实际上<code>setsid</code>运行的进程，其父进程id(ppid)为1(init进程的id)。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code>setsid python3 ./index.py <span class="token operator">&gt;</span>/dev/null <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">&amp;</span>
</code></pre></div><p><strong>语法</strong></p> <ul><li><code>setsid(选项)(参数)</code> <ol><li><code>-c</code>, <code>--ctty</code> 将控制终端设置为当前控制终端</li> <li><code>-f</code>, <code>--fork</code> 总是<code>fork</code></li> <li><code>-w</code>, <code>--wait</code> 等待程序退出，并使用相同的返回</li></ol></li></ul> <h2 id="传输文件"><a href="#传输文件" class="header-anchor">#</a> 传输文件</h2> <ul><li><a href="https://github.com/topics/synchronization" target="_blank" rel="noopener noreferrer">https://github.com/topics/synchronization<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/topics/sync" target="_blank" rel="noopener noreferrer">https://github.com/topics/sync<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/topics/peer-to-peer" target="_blank" rel="noopener noreferrer">https://github.com/topics/peer-to-peer<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/topics/p2p" target="_blank" rel="noopener noreferrer">https://github.com/topics/p2p<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><a href="https://github.com/syncthing/syncthing" target="_blank" rel="noopener noreferrer">https://github.com/syncthing/syncthing<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://github.com/canton7/SyncTrayzor" target="_blank" rel="noopener noreferrer">https://github.com/canton7/SyncTrayzor<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://jiangliheng.github.io/2021/06/10/syncthing" target="_blank" rel="noopener noreferrer">Syncthing 开源文件同步工具<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li>Resilio Sync <a href="https://github.com/bt-sync" target="_blank" rel="noopener noreferrer">https://github.com/bt-sync<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://www.resilio.com/platforms/desktop" target="_blank" rel="noopener noreferrer">https://www.resilio.com/platforms/desktop<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li> <li>微力同步国内 <a href="http://www.verysync.com" target="_blank" rel="noopener noreferrer">http://www.verysync.com<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/schollz/croc" target="_blank" rel="noopener noreferrer">https://github.com/schollz/croc<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li>号称<code>croc</code>通过压缩和多路复用比<code>wormhole</code>，<code>rsync</code>，<code>scp</code>更快（加速<code>1.5</code>倍至<code>4</code>倍）</li></ul></li> <li><a href="https://github.com/magic-wormhole/magic-wormhole" target="_blank" rel="noopener noreferrer">https://github.com/magic-wormhole/magic-wormhole<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/simon-budig/woof" target="_blank" rel="noopener noreferrer">https://github.com/simon-budig/woof<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/stackp/Droopy" target="_blank" rel="noopener noreferrer">https://github.com/stackp/Droopy<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/Peergos/Peergos" target="_blank" rel="noopener noreferrer">https://github.com/Peergos/Peergos<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>命令行共享文件 <a href="https://github.com/dutchcoders/transfer.sh" target="_blank" rel="noopener noreferrer">https://github.com/dutchcoders/transfer.sh<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <blockquote><p>首先进入需要搭建web服务器的目录，然后在输入下面的命令，端口号默认<code>8000</code></p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># python2.7</span>
python -m SimpleHTTPServer port
<span class="token comment"># python3.x</span>
python -m http.server port

<span class="token comment"># 服务开启后，地址协议类型加IP/目录下的文件： </span>
<span class="token function">wget</span> host:port/file 就可以下载了
</code></pre></div><h3 id="scp"><a href="#scp" class="header-anchor">#</a> scp</h3> <blockquote><p>scp（Secure Copy Protocol）基于SSH，是用来进行远程文件拷贝的，不支持排除目录，不支持断点续传</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 把本地的source.txt文件拷贝到192.168.0.10机器上的/home/work目录下</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p /home/work/source.txt work@192.168.0.10:/home/work/
<span class="token comment"># 把192.168.0.10机器上的source.txt文件拷贝到本地的/home/work目录下</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p work@192.168.0.10:/home/work/source.txt /home/work/
<span class="token comment"># 把192.168.0.10机器上的source.txt文件拷贝到192.168.0.11机器的/home/work目录下</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p work@192.168.0.10:/home/work/source.txt work@192.168.0.11:/home/work/
<span class="token comment"># 拷贝文件夹，加-r参数</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p -r /home/work/sourcedir work@192.168.0.10:/home/work/
<span class="token comment"># 使用主机名</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p -r /home/work/sourcedir work@www.myhost.com:/home/work/
<span class="token comment"># 显示详情，加-v参数</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p -r -v /home/work/sourcedir work@www.myhost.com:/home/work/  

<span class="token comment"># 将远程主机复制到本地</span>
<span class="token function">scp</span> -P <span class="token number">22</span> -p root@192.168.214.187:/tmp/demo/f3.log /tmp/files/
</code></pre></div><h3 id="sftp"><a href="#sftp" class="header-anchor">#</a> sftp</h3> <blockquote><p>sftp（SSH File Transfer Protocol）基于SSH，sftp允许对远程文件（查看目录，删除文件和目录等）进行一系列操作，支持断点续传</p></blockquote> <ul><li><code>sftp -oPort=端口 用户名@IP</code> 登录，和ssh一样</li> <li>put 把本地传递到远端（上传）</li> <li>get 把远程传递到本地（下载）</li> <li>ls和lls:ls是看sftp服务器下当前目录下文件， lls是看linux当前目录下的文件。</li> <li>pwd和lpwd:pwd是看远端服务器的目录， 即sftp服务器默认的当前目录。 lpwd是看linux本地目录</li> <li><code>mget *.*</code> 从远端主机接收一批文件至本地主机</li> <li>!command 这个是指在linux上执行command这个命令，比如<code>!ls</code>、<code>!rm a.txt</code></li> <li>exit、quit、bye: 退出。</li> <li>help：再强调一下help，登录以后，一个help，基本可以搞定所有命令</li></ul> <h3 id="rsync"><a href="#rsync" class="header-anchor">#</a> rsync</h3> <blockquote><p>【优点】功能强大，操作类似scp，支持排除目录，支持限速参数；还支持本地复制。</p> <p>【缺点】会耗系统资源，占用I/O</p> <p>【用法】rsync是类unix系统下的数据镜像备份工具，从软件的命名上就可以看出来了——remote sync。
它的操作方式和scp和相似，但是比scp强大很多。使用双冒号分割主机名和文件路径时，是使用rsync服务器</p></blockquote> <ul><li><a href="https://github.com/topics/rsync" target="_blank" rel="noopener noreferrer">https://github.com/topics/rsync<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><a href="https://rsync.samba.org" target="_blank" rel="noopener noreferrer">https://rsync.samba.org<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/probonopd/zsync-curl" target="_blank" rel="noopener noreferrer">https://github.com/probonopd/zsync-curl<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="http://zsync.moria.org.uk" target="_blank" rel="noopener noreferrer">http://zsync.moria.org.uk<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://www.ruanyifeng.com/blog/2020/08/rsync.html" target="_blank" rel="noopener noreferrer">rsync 用法教程<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 把本地的source.txt文件拷贝到192.168.0.10机器上的/home/work目录下</span>
<span class="token function">rsync</span> -e <span class="token string">'ssh -p 22'</span> /home/work/source.txt work@192.168.0.10:/home/work/

<span class="token comment"># 把192.168.0.10机器上的source.txt文件拷贝到本地的/home/work目录下</span>
<span class="token function">rsync</span> work@192.168.0.10:/home/work/source.txt /home/work/

<span class="token comment"># 把192.168.0.10机器上的source.txt文件拷贝到192.168.0.11机器的/home/work目录下</span>
<span class="token function">rsync</span> work@192.168.0.10:/home/work/source.txt work@192.168.0.11:/home/work/

<span class="token comment"># 拷贝文件夹，加-r参数</span>
<span class="token function">rsync</span> -r /home/work/sourcedir work@192.168.0.10:/home/work/

<span class="token comment"># 使用主机名</span>
<span class="token function">rsync</span> -r /home/work/sourcedir work@www.myhost.com:/home/work/

<span class="token comment"># 显示详情，加-v参数</span>
<span class="token function">rsync</span> -r -v /home/work/sourcedir work@www.myhost.com:/home/work/

<span class="token comment"># 排除子目录，注意：--exclude后面的路径不能为绝对路径，必须为相对路径才可以，否则匹配不上，就不会被排除掉。</span>
<span class="token function">rsync</span> -r -v --exclude sourcedir/notinclude /home/work/sourcedir work@www.myhost.com:/home/work/
</code></pre></div><h2 id="性能测试"><a href="#性能测试" class="header-anchor">#</a> 性能测试</h2> <p><strong>bench.sh</strong></p> <blockquote><p>这个是秋水逸冰老大的脚本，用于测试网络下载及主机IO性能测试。是网络上普遍使用的脚本，界面很漂亮。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">wget</span> -qO- bench.sh <span class="token operator">|</span> <span class="token function">bash</span>
</code></pre></div><p><strong>91yun</strong></p> <blockquote><p>这个来自91yun的脚本，主要测试的是网络ping值及路由。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">wget</span> -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh <span class="token punctuation">\</span>
<span class="token operator">&amp;&amp;</span> <span class="token function">bash</span> test_91yun.sh s
</code></pre></div><p><strong>主机运算性能测试</strong></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">wget</span> --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh <span class="token punctuation">\</span>
<span class="token operator">&amp;&amp;</span> <span class="token function">chmod</span> +x unixbench.sh <span class="token operator">&amp;&amp;</span> unixbench.sh
</code></pre></div><p><strong>服务器一键测试脚本</strong></p> <blockquote><p>可以一键检测服务器基本性能，以及网络去程回程的速度。代码整合来自<code>SpeedTest</code>和<code>OldKing</code>的<code>SuperSpeed</code>。</p></blockquote> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 中文版</span>
<span class="token function">wget</span> https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh <span class="token operator">&amp;&amp;</span> <span class="token function">bash</span> ZBench-CN.sh
<span class="token comment"># 英文版</span>
<span class="token function">wget</span> https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh <span class="token operator">&amp;&amp;</span> <span class="token function">bash</span> ZBench.sh
</code></pre></div><blockquote><p>测试完之后，会在/root/下面生成一个 report.html 的文件。</p></blockquote> <p><strong>Superspeed.sh</strong></p> <ul><li><a href="https://github.com/oooldking/script" target="_blank" rel="noopener noreferrer">https://github.com/oooldking/script<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">wget</span> https://raw.githubusercontent.com/oooldking/script/master/superspeed.sh <span class="token punctuation">\</span>
<span class="token operator">&amp;&amp;</span> <span class="token function">chmod</span> +x superspeed.sh <span class="token operator">&amp;&amp;</span> <span class="token function">bash</span> superspeed.sh
</code></pre></div><h2 id="网卡"><a href="#网卡" class="header-anchor">#</a> 网卡</h2> <h3 id="mtu"><a href="#mtu" class="header-anchor">#</a> MTU</h3> <blockquote><p>MTU经过网卡传输的数据包的最大传输单元,传输设备的MTU值不规范造成传输失败的情况</p></blockquote> <p><strong>查看MTU值</strong></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">cat</span> /sys/class/net/eth0/mtu
</code></pre></div><p><strong>临时更改MTU值</strong></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token builtin class-name">echo</span> <span class="token string">&quot;1476&quot;</span> <span class="token operator">&gt;</span> /sys/class/net/eth0/mtu
<span class="token comment"># 或者</span>
<span class="token comment"># ifconfig 网口名 mtu 数值</span>
<span class="token function">ifconfig</span> eth0 mtu <span class="token number">1476</span>
</code></pre></div><p><strong>永久更改MTU值</strong></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">vi</span> /etc/sysconfig/network-scripts/ifcfg-eth0
<span class="token comment"># 在DEVICE=eth0下面加入</span>
<span class="token assign-left variable">MTU</span><span class="token operator">=</span><span class="token number">1476</span>
<span class="token comment"># 启用IPv6地址的，修改IPv6 mtu的参数为</span>
<span class="token assign-left variable">IPV6_MTU</span><span class="token operator">=</span><span class="token string">&quot;1280&quot;</span>
</code></pre></div><p><strong>重启网络接口</strong></p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">service</span> network restart
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/woytu/notes-vuepress/edit/master//System/Linux操作.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021-06-30 18:46:13</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/System/Docker.html" class="prev">
        Docker
      </a></span> <span class="next"><a href="/System/Linux配置.html">
        Linux配置
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.269009d6.js" defer></script><script src="/assets/js/3.974b9720.js" defer></script><script src="/assets/js/67.c18b00e4.js" defer></script>
  </body>
</html>
